package router

import (
	admin "miaoyu/internal/controller/backend/Admin"
	modelAdmin "miaoyu/internal/model/admin"
	"miaoyu/internal/service"
)

func makeAdminRouteMap() []modelAdmin.RouteMap {
	var routeMapList []modelAdmin.RouteMap

	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:         "middleware/CORS",
		Style:       "middleware",
		HandlerFunc: service.Middleware().CORS,
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:         "middleware/CTX",
		Style:       "middleware",
		HandlerFunc: service.Middleware().Ctx,
	})

	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:       "admin/Common/Captcha",
		Style:     "route",
		NickRoute: "/Captcha", //路由别名 有这个则会覆盖默认路径
		Suffix:    "do",
		Method:    "get",
		Handler:   admin.Common.Captcha, //处理器
	})

	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:         "middleware/Auth",
		Style:       "middleware",
		HandlerFunc: service.Middleware().Auth,
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:       "admin/Common/RefreshToken",
		Style:     "route",
		NickRoute: "/RefreshToken",
		Suffix:    "do",
		Method:    "get",
		Handler:   admin.Common.RefreshToken, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:       "admin/Login/Login",
		Style:     "route",
		NickRoute: "/login",
		Suffix:    "mhtml",
		Handler:   admin.Login.Login, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:       "admin/Login/Logout",
		Style:     "route",
		NickRoute: "/Logout",
		Suffix:    "mhtml",
		Handler:   admin.Login.Logout, //处理器
	})

	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:       "admin/Login/DoLogin",
		Style:     "route",
		NickRoute: "/login",
		Method:    "post",
		Suffix:    "do",
		Handler:   admin.Login.DoLogin, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:         "middleware/Access",
		Style:       "middleware",
		Suffix:      "do",
		HandlerFunc: service.Middleware().Access,
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:       "admin/Main/Index",
		Style:     "route",
		NickRoute: "/Main",
		Suffix:    "mhtml",
		Handler:   admin.Main.Index, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:       "admin/Main/Dashboard",
		Style:     "route",
		NickRoute: "/Main/Dashboard",
		Suffix:    "mhtml",
		Handler:   admin.Main.Dashboard, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Main/DoMainInit",
		Style:   "route",
		Suffix:  "do",
		Handler: admin.Main.DoMainInit, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Menu/Index",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Menu.Index, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Menu/MenuEdit",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Menu.MenuEdit, //处理器
	})

	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Menu/MenuAdd",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Menu.MenuAdd, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Menu/DoList",
		Style:   "route",
		Suffix:  "do",
		Handler: admin.Menu.DoList, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Menu/MenuDel",
		Style:   "route",
		Suffix:  "do",
		Method:  "post",
		Handler: admin.Menu.MenuDel, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Menu/DoMenuSubmit",
		Style:   "route",
		Suffix:  "do",
		Method:  "post",
		Handler: admin.Menu.DoMenuSubmit, //处理器
	})

	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Role/Index",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Role.Index, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Role/Add",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Role.Add, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Role/Grant",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Role.Grant, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Role/Edit",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Role.Edit, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Role/DoList",
		Style:   "route",
		Suffix:  "do",
		Handler: admin.Role.DoList, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Role/DoSubmit",
		Style:   "route",
		Suffix:  "do",
		Method:  "post",
		Handler: admin.Role.DoSubmit, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Role/DoDel",
		Style:   "route",
		Suffix:  "do",
		Method:  "post",
		Handler: admin.Role.DoDel, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Role/DoGrantSubmit",
		Style:   "route",
		Suffix:  "do",
		Method:  "post",
		Handler: admin.Role.DoGrantSubmit, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/User/Index",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.User.Index, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/User/Add",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.User.Add, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/User/Grant",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.User.Grant, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/User/Edit",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.User.Edit, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:    "admin/User/DoList",
		Style:  "route",
		Suffix: "do",

		Handler: admin.User.DoList, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/User/DoSubmit",
		Style:   "route",
		Suffix:  "do",
		Method:  "post",
		Handler: admin.User.DoSubmit, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/User/DoDel",
		Style:   "route",
		Suffix:  "do",
		Method:  "post",
		Handler: admin.User.DoDel, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/User/DoGrantSubmit",
		Style:   "route",
		Suffix:  "do",
		Method:  "post",
		Handler: admin.User.DoGrantSubmit, //处理器
	})
	// file
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/File/Upload",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.File.Upload, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/File/AttachmentUpload",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.File.AttachmentUpload, //处理器
	})
	//department
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Department/Index",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Department.Index, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Department/Add",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Department.Add, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Department/Edit",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Department.Edit, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Department/DoList",
		Style:   "route",
		Suffix:  "do",
		Handler: admin.Department.DoList, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Department/DoSubmit",
		Style:   "route",
		Suffix:  "do",
		Method:  "post",
		Handler: admin.Department.DoSubmit, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Department/DoDel",
		Style:   "route",
		Suffix:  "do",
		Method:  "post",
		Handler: admin.Department.DoDel, //处理器
	})
	//level
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Level/Index",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Level.Index, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Level/Add",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Level.Add, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Level/Edit",
		Style:   "route",
		Suffix:  "mhtml",
		Handler: admin.Level.Edit, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Level/DoList",
		Style:   "route",
		Suffix:  "do",
		Handler: admin.Level.DoList, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Level/DoSubmit",
		Style:   "route",
		Suffix:  "do",
		Method:  "post",
		Handler: admin.Level.DoSubmit, //处理器
	})
	routeMapList = append(routeMapList, modelAdmin.RouteMap{
		Key:     "admin/Level/DoDel",
		Style:   "route",
		Suffix:  "do",
		Method:  "post",
		Handler: admin.Level.DoDel, //处理器
	})

	return routeMapList
}
